﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="information_manage.aspx.cs"
    Inherits="TCDC_System.Content.TransectionData.information_manage" %>

<%@ Register TagPrefix="uc" Src="~/UserControl/InformationGroupAdd.ascx" TagName="InformationGroupAdd" %>
<%@ Register TagPrefix="uc" Src="~/UserControl/InformationManageAdd.ascx" TagName="InformationAdd" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        var exportData = function (GridData, GridPanel) {
            GridData.setValue(Ext.encode(GridPanel.getRowsValues({ selectedOnly: false })));
        };
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="mainResource" runat="server" CleanResourceUrl="false" />
    <ext:Hidden ID="GridData" runat="server" />
    <ext:Viewport ID="Viewport1" runat="server" Layout="border">
        <Items>
            <ext:GridPanel ID="GridPanelInformationGroup" runat="server" Region="Center" DDGroup="gridDDGroup"
                EnableDragDrop="false" StripeRows="true" Title="InformationGroup" Icon="Vcard"
                Frame="true">
                <TopBar>
                    <ext:Toolbar ID="Toolbar1" runat="server">
                        <Items>
                            <ext:Button ID="btAdd" runat="server" Text="Add" Icon="Add" OnDirectClick="AddInformationGroup" />
                            <ext:ToolbarSeparator />
                            <ext:Button ID="btDelete" runat="server" Text="Delete" Icon="Delete">
                                <DirectEvents>
                                    <Click OnEvent="DeleteInformationGroup">
                                        <EventMask ShowMask="true" />
                                    </Click>
                                </DirectEvents>
                            </ext:Button>
                            <ext:ToolbarSeparator />
                            <ext:ToolbarFill ID="ToolbarFill1" runat="server" />
                            <ext:Button ID="btExcel" runat="server" AutoPostBack="true" OnClick="ExportExcelInformationGroup"
                                Text="To Excel" Icon="PageExcel">
                                <Listeners>
                                    <Click Handler="exportData(#{GridData},#{GridPanelInformationGroup});" />
                                </Listeners>
                            </ext:Button>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <Store>
                    <ext:Store runat="server" ID="StoreInformationGroup" OnRefreshData="StoreInformationGroup_Refresh">
                        <Reader>
                            <ext:JsonReader IDProperty="information_group_id">
                                <Fields>
                                    <ext:RecordField Name="information_group_id" />
                                    <ext:RecordField Name="information_group_desc" />
                                    <ext:RecordField Name="object_type" />
                                    <ext:RecordField Name="sorting_group_no" />
                                </Fields>
                            </ext:JsonReader>
                        </Reader>
                    </ext:Store>
                </Store>
                <ColumnModel>
                    <Columns>
                        <ext:RowNumbererColumn />
                        <ext:Column Header="information_group_id" DataIndex="information_group_id" Width="100"
                            Align="Center" />
                        <ext:Column Header="information_group_desc" DataIndex="information_group_desc" Width="400">
                            <Editor>
                                <ext:TextField ID="TextField1" runat="server" AllowBlank="false" MsgTarget="Side" />
                            </Editor>
                        </ext:Column>
                        <ext:Column Header="object_type" DataIndex="object_type" Width="100" Align="Center">
                            <Editor>
                                <ext:TextField ID="TextField2" runat="server" AllowBlank="false" MsgTarget="Side" />
                            </Editor>
                        </ext:Column>
                        <ext:Column Header="sorting_group_no" DataIndex="sorting_group_no" Width="100" Align="Center">
                            <Editor>
                                <ext:NumberField ID="NumberField1" runat="server" AllowBlank="false" MsgTarget="Side" />
                            </Editor>
                        </ext:Column>
                    </Columns>
                </ColumnModel>
                <Plugins>
                    <ext:GridFilters ID="GridFilters2" runat="server" Local="true">
                        <Filters>
                            <ext:StringFilter DataIndex="information_group_id" />
                            <ext:StringFilter DataIndex="information_group_desc" />
                            <ext:StringFilter DataIndex="object_type" />
                            <ext:StringFilter DataIndex="sorting_group_no" />
                        </Filters>
                    </ext:GridFilters>
                    <ext:RowEditor ID="RowEditorInformationGroup" runat="server" SaveText="Update">
                        <DirectEvents>
                            <AfterEdit OnEvent="UpdateInformationGroup">
                                <ExtraParams>
                                    <ext:Parameter Name="InformationGroupValue" Value="Ext.encode(#{GridPanelInformationGroup}.getRowsValues({selectedOnly:true}))"
                                        Mode="Raw">
                                    </ext:Parameter>
                                </ExtraParams>
                                <EventMask ShowMask="true" />
                            </AfterEdit>
                        </DirectEvents>
                    </ext:RowEditor>
                </Plugins>
                <SelectionModel>
                    <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true">
                        <DirectEvents>
                            <RowSelect OnEvent="rowSelectInformationGroup" Buffer="100">
                                <ExtraParams>
                                    <ext:Parameter Name="information_group_id" Value="this.getSelected().data.information_group_id"
                                        Mode="Raw" />
                                </ExtraParams>
                            </RowSelect>
                        </DirectEvents>
                    </ext:RowSelectionModel>
                </SelectionModel>
                <LoadMask ShowMask="true" />
                <BottomBar>
                    <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="19" DisplayInfo="true"
                        EmptyMsg="No Request to display" />
                </BottomBar>
            </ext:GridPanel>
            <ext:GridPanel ID="GridPanelInformation" runat="server" Region="South" Title="Information"
                DDGroup="gridDDGroup" EnableDragDrop="false" StripeRows="true" Collapsible="true"
                Collapsed="true" Layout="FitLayout" Icon="Vcard" Height="250">
                <TopBar>
                    <ext:Toolbar ID="Toolbar2" runat="server">
                        <Items>
                            <ext:Button ID="Button1" runat="server" Text="Add" Icon="Add" OnDirectClick="AddInformation" />
                            <ext:ToolbarSeparator />
                            <ext:Button ID="Button2" runat="server" Text="Delete" Icon="Delete">
                                <DirectEvents>
                                    <Click OnEvent="DeleteInformation">
                                        <EventMask ShowMask="true" />
                                    </Click>
                                </DirectEvents>
                            </ext:Button>
                            <ext:TextField ID="txt_information_group_id" runat="server" Hidden="true" />
                            <ext:ToolbarSeparator />
                            <ext:ToolbarFill ID="ToolbarFill2" runat="server" />
                            <ext:Button ID="Button3" runat="server" AutoPostBack="true" OnClick="ExportExcelInformation"
                                Text="To Excel" Icon="PageExcel">
                                <Listeners>
                                    <Click Handler="exportData(#{GridData},#{GridPanelInformation});" />
                                </Listeners>
                            </ext:Button>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <Store>
                    <ext:Store runat="server" ID="StoreInformation" OnRefreshData="StoreInformation_Refresh">
                        <Reader>
                            <ext:JsonReader IDProperty="information_id">
                                <Fields>
                                    <ext:RecordField Name="information_id" />
                                    <ext:RecordField Name="information_group_id" />
                                    <ext:RecordField Name="information_desc" />
                                    <ext:RecordField Name="sorting_information_no" />
                                </Fields>
                            </ext:JsonReader>
                        </Reader>
                    </ext:Store>
                </Store>
                <ColumnModel>
                    <Columns>
                        <ext:RowNumbererColumn />
                        <ext:Column Header="information_id" DataIndex="information_id" Width="100" Align="Center" />
                        <ext:Column Header="information_desc" DataIndex="information_desc" Width="500">
                            <Editor>
                                <ext:TextField ID="TextField3" runat="server" AllowBlank="false" MsgTarget="Side" />
                            </Editor>
                        </ext:Column>
                        <ext:Column Header="sorting_information_no" DataIndex="sorting_information_no" Width="100"
                            Align="Center">
                            <Editor>
                                <ext:NumberField ID="NumberField3" runat="server" AllowBlank="false" MsgTarget="Side" />
                            </Editor>
                        </ext:Column>
                    </Columns>
                </ColumnModel>
                <Plugins>
                    <ext:GridFilters ID="GridFilters1" runat="server" Local="true">
                        <Filters>
                            <ext:StringFilter DataIndex="information_id" />
                            <ext:StringFilter DataIndex="information_group_id" />
                            <ext:StringFilter DataIndex="information_desc" />
                            <ext:StringFilter DataIndex="sorting_information_no" />
                        </Filters>
                    </ext:GridFilters>
                    <ext:RowEditor ID="RowEditorInformation" runat="server" SaveText="Update">
                        <DirectEvents>
                            <AfterEdit OnEvent="UpdateInformation">
                                <ExtraParams>
                                    <ext:Parameter Name="InformationValue" Value="Ext.encode(#{GridPanelInformation}.getRowsValues({selectedOnly:true}))"
                                        Mode="Raw">
                                    </ext:Parameter>
                                </ExtraParams>
                                <EventMask ShowMask="true" />
                            </AfterEdit>
                        </DirectEvents>
                    </ext:RowEditor>
                </Plugins>
                <SelectionModel>
                    <ext:RowSelectionModel ID="RowSelectionModel2" runat="server" SingleSelect="true" />
                </SelectionModel>
                <LoadMask ShowMask="true" />
                <BottomBar>
                    <ext:PagingToolbar ID="PagingToolbar2" runat="server" PageSize="19" DisplayInfo="true"
                        EmptyMsg="No Request to display" />
                </BottomBar>
            </ext:GridPanel>
        </Items>
    </ext:Viewport>
    <uc:InformationGroupAdd ID="InformationGroupAdd1" runat="server" />
    <uc:InformationAdd ID="InformationManageAdd1" runat="server" />
    </form>
</body>
</html>
